<template>
	<view>
		<text class="zy-btn" @click="onClick" v-if="size=='normal' || size=='sm'"
			:class="{'normal': size== 'normal', 'sm': size== 'sm', 'hollow':hollow}">
			{{text || content}}
		</text>
		
		<view class="zy-btn full" @click="onClick" v-if="size=='full'"
		:class="{'hollow':hollow}">
		{{text || content}} </view>
	</view>
</template>

<script>
	export default {
		name: "zy-button",
		data() {
			return {

			};
		},
		props: {
			text: {
				type: String,
			},
			content: {
				type: String,
			},
			size: {
				//full normal sm  小----根据字体大小 + padding---控制按钮大小
				type: String,
				default () {
					return 'full'
				}
			},
			// 镂空
			hollow: {
				type: Boolean,
				default () {
					return false
				}
			}
		},
		methods: {
			onClick() {
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.zy-btn {
		background: linear-gradient(to right, #06EBD8, #14B9D9);
		color: #fff;
		text-align: center;
		border-radius: 50rpx;
	}

	.hollow {
		border: 2rpx solid #1ECBDA;
		color:#1ECBDA;
		background: rgba(#fff, 0);
	}

	.full {
		font-size: 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		width: 100%;
		font-weight: $zy-font-bold;
	}

	.sm {
		font-size: 20rpx;
		padding: 8rpx 15rpx;
		border-radius: 30rpx;
	}

	.normal {
		font-size: 32rpx;
		padding: 15rpx 45rpx;
		font-weight: $zy-font-bold;
	}
</style>